"use strict";
require([
  'polyfill',
  './dev/layer',
  './dev/nav',
 './dev/book',
  './conf/baseConfig',
  './dev/helper',
  './dev/link'
], function (polyfill, layer, nav, book, baseConfig, helper, Link) {
  nav.showNav();

  //layer.loadLayer();

  const getBookshandle = (json)=>{
    const dtd = $.Deferred();
    $.getJSON(json, (data) => {
      dtd.resolve(data);
    }, (err) => {
      console.log(err);
      dtd.reject();
    });
    return dtd.promise();
  };

  getBookshandle("./data/books.json").then((data)=>{
    const list = data.list,
           target = "book0",
           prams = "bookId";
    let index = helper.findIndexData(target, list, prams);
    const bookConf = {
      bookId:list[index].bookId,
      amount:list[index].amount,
      SerPath:list[index].SerPath,
      packName:list[index].packName,
      filename:list[index].filename
    };
    book.bookMaz(bookConf)

  });








});

